package com.itdragon.cloud.eurekaServer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @EnableEurekaClient 表明自己是一个eureka Client
 * @SpringBootApplication SpringBoot 启动Application的注解
 * @RestController @Controller 升级版，是@Controller + @Responsebody 合体
 */
@EnableEurekaClient
@SpringBootApplication
@RestController
public class EurekaClientApplication {

	public static void main(String[] args) {
		SpringApplication.run(EurekaClientApplication.class, args);
	}
	
	@Value("${server.port}")
	private String port;
	
	@RequestMapping("/helloworld")
	public String helloworld(@RequestParam("hello") String hello) {
		return hello + " : " + port;
	}
}
